from concurrent.futures import ProcessPoolExecutor, as_completed
import time


def print_chars(char, n, interval=0.05):
    for i in range(n):
        time.sleep(interval)
        print(f'{char}', end='', flush=True)
    return char, n, interval


if __name__ == '__main__':

    MAX = 10

    def main(n, m):
        tasks = []
        with ProcessPoolExecutor(max_workers=MAX) as pool:
            for i in range(1, m + 1):
                process = pool.submit(print_chars, char=i, n=n)
                tasks.append(process)

        for obj in as_completed(tasks):
            print(obj.result())

    main(50, 4)
